<?php
/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/6/20
 * Time: 上午11:30
 */

namespace app\index\controller;



use app\index\exception\UserException;
use app\index\model\User;
use app\index\service\UserService;
use app\index\utils\ResultUtil;
use think\Controller;

class Auth extends Controller
{
    public function checklogin($uid = ""){
        $user = new User();
        $res = $user->getUserByUid($uid);
        if($res == null){
            throw new UserException(1001,"用户不存在");
        }
        $ret = UserService::getUserLoginStatus($uid,$res['phone']);
        return ResultUtil::success($ret);
    }
}